package org.zero.onlinesubject;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.zero.onlinesubject.service.impl.WebSocketServer;

@SpringBootApplication
@EnableAspectJAutoProxy
@EnableScheduling
public class OnlineSubjectApplication {

    public static void main(String[] args) {
        Runtime.getRuntime().addShutdownHook(new Thread(()->{
            System.out.println("程序中断，关闭所有开启进程...");
        }));
        ConfigurableApplicationContext context = SpringApplication.run(OnlineSubjectApplication.class, args);
        WebSocketServer.setApplicationContext(context);
    }
}
